package com.hzy.servlet;

import com.hzy.service.RentService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Package: com.hzy.servlet
 * @ClassName: UpdateStatusServlet
 * @Author: 862982795
 * @CreateTime: 2021/06/23 20:02
 * @Description:
 */
@WebServlet("/UpdateStatusServlet")
public class UpdateStatusServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("utf-8");
        response.setCharacterEncoding("utf-8");
        response.setContentType("text/html;charset=utf-8");
        RentService service = new RentService();

        Integer id = Integer.valueOf(request.getParameter("id"));

        int i = service.updateStatus(id);

        response.getWriter().println(i);


    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request, response);
    }
}
